import {get, post, del, put, upload } from './http.js'
const baseURL = 'secondary/'
    // ------------------------------ start SecondaryTask.vue -------------------------------------
    // 获取TaskList
export const secondaryGetTaskList = params => { return get(`${baseURL}task/list`, params) }
    // 接取任务
export const receiveTask = params => { return post(`${baseURL}task/receive`, params) }
    // ------------------------------ end SecondaryTask.vue -------------------------------------

// 未完成任务列表
// ------------------------------ start FulfilledTask.vue -------------------------------------
// 获取二级未完成任务列表
export const getSecondaryOngoingTask = params => { return get(`${baseURL}task/ongoing`, params) }

// 申请完成任务
export const secondaryAccomplishTask = params => { return post(`${baseURL}task/finish`, params) }
    // ------------------------------ end FulfilledTask.vue -------------------------------------

// ------------------------------ start FailTask.vue -------------------------------------
//  获取二级任务列表 根据参数决定查询的类型
export const secondaryGetCompletedTask = params => { return get(`${baseURL}task/completed`, params) }

// ------------------------------ end FailTask.vue -------------------------------------

// ------------------------------ start SecondaryShop.vue -------------------------------------
// 兑换奖励
export const secoondaryBuyShop = params => { return post(`${baseURL}shop/buy`, params) }
    // 二级用户获取可兑换奖励列表
export const secoondaryGetShopList = params => { return get(`${baseURL}shop/list`, params) }

// ------------------------------ end SecondaryShop.vue -------------------------------------


// ------------------------------ start SecondaryPackage.vue -------------------------------------
export const secoondaryGetPackageList = params => { return get(`${baseURL}package/list`, params) }
export const secondaryUsePackge = params => { return put(`${baseURL}package/use/shop`, params) }
    // ------------------------------ end SecondaryPackage.vue -------------------------------------

// ------------------------------ start SecondaryCommitment.vue -------------------------------------
export const getcommitmentList = params => { return get(`${baseURL}commitment/list`, params) }

// ------------------------------ end SecondaryCommitment.vue -------------------------------------
export const uploadImg = formData => { return upload(`${baseURL}task/upload`, formData) }